create database FORUM
go
use FORUM
GO

create table tbl_Account
(
	AccountId int identity(1,1) primary key ,
	Username nvarchar(100),
	[Password] nvarchar(100),
	FullName nvarchar(100),
	Gender bit,
	[Address] nvarchar(500),
	DateOfBirth datetime,
	Email nvarchar(100),
	[Image] nvarchar(500),
	Career nvarchar(100),
	[Status] int,
)
go

create table tbl_Topic --chu de bai viet
(
	TopicId int identity(1,1) primary key,
	TypeTopicId int,
	NameTopic nvarchar(100),
	UrlTopic nvarchar(100),
	Number int,--so thu tu
	[Status] int,
)
go 

create table tbl_TypeTopic
(
	TypeTopicId int identity(1,1) primary key,
	NameType nvarchar(100),
	[Description] nvarchar(500),
	Number int,
	[Status] int,
)
go


create table Comment
(
	CommentId	int identity(1,1) primary key,
	UserId		int,
	ArticleId	int,
	[Day]		datetime,
	Content		nvarchar(500),
	[Status]	int,
)
go


create table Article--bai viet
(
	ArticleId	int identity(1,1) primary key,
	ArticleName	nvarchar(100),
	[Description]	nvarchar(500),
	ArticleTypeId	int,
	DaySend		datetime,
	Sender nvarchar(100),--nguoi gui
	UrlArticleType		nvarchar(100),
	UrlTopic	nvarchar(100),
	[View]		int,
	Thanks		int,
	Comment nvarchar(500),
	[Status]	int,
)
go



create table ArticleType
(
	ArticleTypeId int identity(1,1) primary key,
	ArticleTypeName nvarchar(100),
	[Description] nvarchar(500),
	Number int,
	[Status] int,
)
go






